#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

import sys

current_task_id=1
count=0

infile=open(sys.argv[1],'r')
outfile=open("pmc_task/pmc_id_"+str(current_task_id)+".txt",'w')

infile.readline()
for line in infile:
    line=line.rstrip()
    pmc_id=line.split(",")[8]
    pmc_id=pmc_id[3:]
    outfile.write(pmc_id+"\n")
    outfile.flush()
    count+=1
    if count==10000:
        outfile.close()
        count=0
        current_task_id+=1
        outfile=open("pmc_task/pmc_id_"+str(current_task_id)+".txt",'w')
outfile.close()
infile.close()




